﻿namespace LoginSample.Tests
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using LoginSample.Models;

    public class UserDaoMock : IUserDao
    {
        private List<User> users = new List<User>();

        public void Add(User user)
        {
            this.users.Add(user);
        }

        public void Remove(User user)
        {
            this.users.Remove(user);
        }

        public User GetByUsername(string username)
        {
            return this.users.Where(u => u.Username.Equals(username)).FirstOrDefault();
        }

        public List<User> GetAll()
        {
            return this.users;
        }
    }
}
